changeset 829:a204fc1d1145

optimized vflist_setup_iter
author nadvornik
date Fri, 13 Jun 2008 21:32:58 +0000
parents 08a78e3e06f9
children a06d885de883
files src/view_file_list.c
diffstat 1 files changed, 17 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/view_file_list.c	Fri Jun 13 13:33:11 2008 +0000
+++ b/src/view_file_list.c	Fri Jun 13 21:32:58 2008 +0000
@@ -738,10 +738,26 @@
 					FILE_COLUMN_SIDECARS, sidecars,
 					FILE_COLUMN_SIZE, size,
 					FILE_COLUMN_DATE, text_from_time(fd->date),
+#define STORE_SET_IS_SLOW 1
+#if STORE_SET_IS_SLOW	
+/* this is 3x faster on a directory with 20000 files */
+					FILE_COLUMN_MARKS + 0, file_data_get_mark(fd, 0),
+					FILE_COLUMN_MARKS + 1, file_data_get_mark(fd, 1),
+					FILE_COLUMN_MARKS + 2, file_data_get_mark(fd, 2),
+					FILE_COLUMN_MARKS + 3, file_data_get_mark(fd, 3),
+					FILE_COLUMN_MARKS + 4, file_data_get_mark(fd, 4),
+					FILE_COLUMN_MARKS + 5, file_data_get_mark(fd, 5),
+#if FILEDATA_MARKS_SIZE != 6
+#error this needs to be updated  
+#endif
+#endif
 					FILE_COLUMN_COLOR, FALSE, -1);
+
+#if !STORE_SET_IS_SLOW					
+
 	for (i = 0; i < FILEDATA_MARKS_SIZE; i++)
 		gtk_tree_store_set(store, iter, FILE_COLUMN_MARKS + i, file_data_get_mark(fd, i), -1);
-
+#endif
 	g_free(size);
 	if (sidecars)
 		g_free(sidecars);