Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > More E-Book Readers > iRex > iRex Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 03-25-2011, 10:16 PM   #1
Iņigo
Guru
Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.
 
Posts: 712
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, in love with iRex DR800S. Also a K4NT. Now a Kobo Aura
Talking Secret at dawn (aka testing strange things)

Ok, as I've promised in another thread, here you have a little present.

Uncompress attached file and copy "Test" directory to your DR "Programs" folder.
Then navigate there and tap on the .desktop item.
No screenshots now, just check the app and say what you think:
- start time
- overall run speed
- menu integration
- feelings

It has been harder than what I thought initially but I hope it opens a new way to develop apps for DR devices!

Ok, I'm not telling anything more by now, tell me your impressions and in a couple of days I promise I'll explain all of this mistery and show the sources...

Iņigo
Attached Files
File Type: gz Test.tar.gz (34.4 KB, 116 views)
Iņigo is offline   Reply With Quote
Old 03-25-2011, 11:04 PM   #2
fekhner
Addict
fekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animals
 
Posts: 326
Karma: 6908
Join Date: Sep 2010
Device: DRs, EE, ipad/iphone, Helix
I am a little puzzled, it looks like the same (very nice) System Information app that you provided for us some time ago ?
fekhner is offline   Reply With Quote
Old 03-26-2011, 07:15 AM   #3
repods
Addict
repods is on a distinguished road
 
Posts: 225
Karma: 72
Join Date: Jan 2010
Device: irex DR-800S, M92S
well as you should know very little people try stuff without knowing anything about it..

in any case your enthusiasm should mean that you did something good..
let's hope so..
repods is offline   Reply With Quote
Old 03-26-2011, 08:33 AM   #4
rvs
Groupie
rvs has a complete set of Star Wars action figures.rvs has a complete set of Star Wars action figures.rvs has a complete set of Star Wars action figures.rvs has a complete set of Star Wars action figures.
 
Posts: 181
Karma: 364
Join Date: Oct 2009
Device: DR1000s, Hanlin V5
A great app for getting system information.

It loads and runs fast on my DR1000.
Menu integration is nice. Perhaps the chosen refresh-option could be presented in boldscript (so as to know which is the current refresh cycle)?

The CPU always shows 100% idle on my device, but perhaps this is as expected? Also, it says "no information available" on the battery status.

Overall, very nice app. I also like the option to kill off a process, though I haven't dared to test it yet

Edit: Skip the part about the CPU always showing 100% idle, it turns out to be incorrect.

Last edited by rvs; 03-26-2011 at 09:02 AM.
rvs is offline   Reply With Quote
Old 03-26-2011, 11:42 AM   #5
Mackx
Guru
Mackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to behold
 
Posts: 998
Karma: 19985
Join Date: Dec 2008
Location: Netherlands
Device: iRex DR1000S
<GUESS MODE>
I think you created a framework that allows to build stand-alone lua applications for the DR? Allowing more people to write applications for the DR.
<\GUESS MODE>
Mackx is offline   Reply With Quote
Old 03-26-2011, 02:39 PM   #6
Iņigo
Guru
Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.
 
Posts: 712
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, in love with iRex DR800S. Also a K4NT. Now a Kobo Aura
new version attached, with some improvements:
- battery information (this has been hard, all that dbus stuff)
- menu items indicates fullscreen mode and refresh timer in bold (easy)

Anyway, I'm not as interested in the application per se as the internal hidden part.
But perhaps I'll create a proper package for it anyway.

I'll need some time to write the explanations and I'm quite exhausted now.
I'll try to post them between this evening and tomorrow.

Mackx: I thought you'd say this ;-)
In fact I studied a similar approach with luajit (which has a beautiful FFI since a few weeks ago, which would allow to call IREX libs directly without writing bindings) but sadly enough luajit doesn't compile in ARM processors by now, maybe in some months.

EDIT: btw, for the ones that checked the lua version, do you feel any speed difference in the start time or with the general use?

Iņigo
PS: and sorry for this stupid mistery, but I'm liking it
Attached Files
File Type: gz Test.tar.gz (33.9 KB, 108 views)

Last edited by Iņigo; 03-26-2011 at 02:46 PM.
Iņigo is offline   Reply With Quote
Old 03-26-2011, 06:19 PM   #7
Iņigo
Guru
Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.
 
Posts: 712
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, in love with iRex DR800S. Also a K4NT. Now a Kobo Aura
Secret revealed

Executive summary
SysInfo is a proof of concept application written in a language called Vala [1] to test if Vala is a viable development method for iRex DR ereaders.


Historical note
During some months I've been maturing the idea to extend DR core programs without C, using an easier and faster (to write code in) language. So I started learning and playing with lua, waiting for LuaJIT [2] to be available for ARM processors. This would allow us to use the impressive FFI support in LuaJIT to call DR libraries from lua code without writing bindings. But ARM processors are not supported yet...

And I was musing this mood when I unexpectedly read a MobileReader thread I haven't seen before [3].
All credit for exploring this idea is for ross therefore.


Vala
Vala is a new language created in the GNOME desktop world. People say its syntaxis is similar to C# or Java, but I can't say it myself because I don't know much about both of them.

The main feature of Vala is that it compiles from .vala sources to C code, which is then compiled and linked to generate the final machine code. Note the whole compilation from .vala sources to binary program can be performed in just one step too.

Though more low level than lua or python, it's easier and faster to code than C, and offers much more faster execution speed than scripting languages (but not as fast as plain C).

Vala also comes with lot of "bindings" for many popular libraries.
And it's easy to write bindings for "our" DR libraries (take a look at "liberipc.vapi" file).

But the main advantage I see for DR development is that we could write modules in Vala easily, and then use these C sources to extend original firmware.


Current status of Vala for DR development
I've taken what ross provided and updated to support modern versions of Vala.
I've also fixed and improved the irex.vala and liberipc.vapi files. More will come as needed.

Note that Vala is not perfect, it's quite new and in continue development.
I've also found some issues: vala is so new that it sometimes depends on the last versions of glib to do some tasks, and this causes problems with the "old" libraries coming with DRs.
F.e, I couldn't find a better way to get current date and time in a custom format that to parse OS "date +fmt". Posix or glib 2.26+ contain functions to do it, but both of them are not available for DR development.

Anyway, I've been able to translate and improve a previously lua-written program (SysInfo) into vala without prior knowledgement of Vala or C# in ~10 hours of work. Most of this time was spent reading Vala documentation, fixing the Vala environment (irex.vala, liberipc.vapi) and fighting against some imcompatibilities between vala v0.11.x and DR older libraries.

I'm pretty satisfied with the results, this first program looks fast, robust, integrates well with DR and even doesn't depend on external runtime or libraries.

But what excited me most is the now opened possibility to write enhancements to core DR programs using a higher level language than C, so we could test new ideas faster and with less effort.


Instructions to compile SysInfo.vala
Steps:
Code:
- You need a running DR development environment
- Download, build and install Vala
  . download v0.11.7 from [1]
  . patch or change vala-0.11.7/vala/valaflowanalyzer.vala with the supplied file
  . build and install Vala using devel machine compiler (i.e, gcc, not arm-poky-linux-gnueabi-gcc)
- Build SysInfo:
  . put all the needed files in the same directory: SysInfo.vala, irex.vala, liberipc.vapi
  . set the cross-compiling environment:
    $ source /usr/local/poky/eabi-glibc/arm/environment-setup
  . run "make" or:
    $ valac --vapidir=. --pkg gtk+-2.0 --pkg=gdk-x11-2.0 --pkg liberipc --pkg posix SysInfo.vala irex.vala -o SysInfo
- That's it
  . there will be many warnings, they don't matter
Installation
This is a vala testing package not intented for general use.
Anyway, you can copy the "bin" folder contents to <SD card>/Programs to get a fully functional program.
Eventually I'll split these contents into a SysInfo package for end user consumption and a vala development package.


[1] http://live.gnome.org/Vala
[2] http://luajit.org/
[3] http://www.mobileread.com/forums/showthread.php?t=39212


Kind regards,
Iņigo Serna
Attached Files
File Type: gz Vala-SysInfo.tar.gz (51.4 KB, 104 views)
Iņigo is offline   Reply With Quote
Old 03-27-2011, 11:06 AM   #8
Mackx
Guru
Mackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to behold
 
Posts: 998
Karma: 19985
Join Date: Dec 2008
Location: Netherlands
Device: iRex DR1000S
Quote:
Originally Posted by Iņigo View Post
Executive summary
SysInfo is a proof of concept application written in a language called Vala [1] to test if Vala is a viable development method for iRex DR ereaders.
Aha, so I was close with my guess
Quote:
Originally Posted by Iņigo View Post
But the main advantage I see for DR development is that we could write modules in Vala easily, and then use these C sources to extend original firmware.
Sounds good. Do you want to add a plug-in mechanism to the firmware components or how do you to accomplish this?
I will be closely following your progress.
Mackx is offline   Reply With Quote
Old 04-02-2011, 07:43 AM   #9
Iņigo
Guru
Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.
 
Posts: 712
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, in love with iRex DR800S. Also a K4NT. Now a Kobo Aura
Quote:
Originally Posted by Mackx View Post
Aha, so I was close with my guess
Of course, I was clearer than pure water... hehehe

Quote:
Originally Posted by Mackx View Post
Sounds good. Do you want to add a plug-in mechanism to the firmware components or how do you to accomplish this?
I will be closely following your progress.
something simpler, write .vala code, compile to C and compile these C addons with the original firmware.

I've been travelling this week and had no much time to hack on this, but I'll publish new and improved versions of SysInfo and Icons tools soon.
Besides their own merits as useful applications, they also served me to learn vala.
All of you can look at the sources, if you are familiar with C, C++, C# or Java you will be able to write vala programs in almost no time.

My next plan is to modify popupmenu to add 2 new entries and release a new version of DR800+:
- Go to Programs
- System Information
They are not directly related to this vala work, but I think they are interesting for DR800+ (or perhaps even Mackx's additions).
"System Information" will run sysinfo binary as an external program, so "sysinfo" will be copied to /usr/bin when installing DR800+. I also consided the alternative to add the generated .c code to popupmenu and be part of popupmenu core, but I think it's better it remains an external app.


Long term idea is to hack on ctb:
- nowdays when you enter into "Books" or "Recently Added" virtual folders, all the books are extracted from the DB, so it's very slow if you have lots of books. My idea is to only query for next "page" (SQLite admits LIMIT and OFFSET)
- add a "Recently opened" virtual folder to HOME
- improve view sorting in Books folder, maybe adding sort modes as icons to the toolbar at the bottom


What do you think?

Iņigo
Iņigo is offline   Reply With Quote
Old 04-02-2011, 08:56 AM   #10
Mackx
Guru
Mackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to behold
 
Posts: 998
Karma: 19985
Join Date: Dec 2008
Location: Netherlands
Device: iRex DR1000S
Quote:
Originally Posted by Iņigo View Post
something simpler, write .vala code, compile to C and compile these C addons with the original firmware.
OK, I understand, on the other hand Lua could be used to create 'user modifiable' scripts that are executed at specific locations in the code. This would however take a lot of effort and time to define locations where to run lua-script and define interfaces to modify standard behaviour by the scripts. (Mmm as I am writing this down it sounds interesting, maybe I should put it on my long-term todo list ...)
Quote:
Originally Posted by Iņigo View Post
My next plan is to modify popupmenu to add 2 new entries and release a new version of DR800+:
- Go to Programs
- System Information
They are not directly related to this vala work, but I think they are interesting for DR800+ (or perhaps even Mackx's additions).
"System Information" will run sysinfo binary as an external program, so "sysinfo" will be copied to /usr/bin when installing DR800+. I also consided the alternative to add the generated .c code to popupmenu and be part of popupmenu core, but I think it's better it remains an external app.
The dr1000-hackx (new name for MackxPatch) has a mechanism to add new icons on the Home/Desktop. One that is added is called Applications, it shows all files that have been tagged with 'application'. It is similar to the 'Go to Programs' although it requires that the files are tagged correctly. (Note that dr1000-hackx allows to add multiple tags to a document.)
Quote:
Originally Posted by Iņigo View Post
Long term idea is to hack on ctb:
- nowdays when you enter into "Books" or "Recently Added" virtual folders, all the books are extracted from the DB, so it's very slow if you have lots of books. My idea is to only query for next "page" (SQLite admits LIMIT and OFFSET)
I am wondering how much this solves, the sql-query still needs to gather info on all document, sort them according to the sorting criteria and then select the information that is really required. But I think it is worth a measurement to see if it saves some time.
Quote:
Originally Posted by Iņigo View Post
- add a "Recently opened" virtual folder to HOME
You should be able to merge that from dr1000-hackx. (Although the settings dialog to control the appearance and order of views in Home, needs some extra work to make it more user friendly.)
Quote:
Originally Posted by Iņigo View Post
- improve view sorting in Books folder, maybe adding sort modes as icons to the toolbar at the bottom
I assume that the 'real' problem is that you cannot find your books quick enough? I started working on a function that allows selection of books based on its tag. Tagging each document with several tags e.g.: 'book programming vala' would show the document in the normal 'Books'-View, but also allows to fine-tune the selection with 'programming' and/or 'vala'.
Maybe I should post the new version as a pre-release so you can play with it in the emulator? (The new version also allows tagging multiple documents.)

Marcel.
Mackx is offline   Reply With Quote
Old 04-02-2011, 11:46 AM   #11
Iņigo
Guru
Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.
 
Posts: 712
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, in love with iRex DR800S. Also a K4NT. Now a Kobo Aura
Quote:
Originally Posted by Mackx View Post
OK, I understand, on the other hand Lua could be used to create 'user modifiable' scripts that are executed at specific locations in the code. This would however take a lot of effort and time to define locations where to run lua-script and define interfaces to modify standard behaviour by the scripts. (Mmm as I am writing this down it sounds interesting, maybe I should put it on my long-term todo list ...)
Lua is a superb tool for those uses, but do we need them? is the only way to do them?
After a few days playing with Vala, I think I've lost my initial interest in lua as a development tool for DR. Vala is only a bit harder but it's faster, can be completely integrated with DR and doesn't require external dependencies.

Quote:
Originally Posted by Mackx View Post
The dr1000-hackx (new name for MackxPatch) has a mechanism to add new icons on the Home/Desktop. One that is added is called Applications, it shows all files that have been tagged with 'application'. It is similar to the 'Go to Programs' although it requires that the files are tagged correctly. (Note that dr1000-hackx allows to add multiple tags to a document.)
I was thinking in another way: instead of "wasting" one precious item on HOME (DR800 only allows 12 per page, 11 default links + 1 "continue reading last opened book"), my idea is to put a link on the popupmenu, not on ctb's HOME, which would open <SD card>/Programs folder.
It's easier to code and requires same work for the user, 2 clicks (menu and menu-link vs. HOME and home-link).

Quote:
Originally Posted by Mackx View Post
I am wondering how much this solves, the sql-query still needs to gather info on all document, sort them according to the sorting criteria and then select the information that is really required. But I think it is worth a measurement to see if it saves some time.
Maybe I'm missing something... but we could create specialized queries for each view, using LIMIT and OFFSET clauses we'd avoid retrieving DB rows for every book in the DR.
The only problem I can think of is the Sort by Title / Author that requires all the items to build the ABCDE toolbar at the right. Don't think the other view modes (by size, by file type, by recently opened, by added) require to retrieve all books.

Quote:
Originally Posted by Mackx View Post
You should be able to merge that from dr1000-hackx. (Although the settings dialog to control the appearance and order of views in Home, needs some extra work to make it more user friendly.)
Of course, my intentions is to steal lots of code from there ;-)

Quote:
Originally Posted by Mackx View Post
I assume that the 'real' problem is that you cannot find your books quick enough? I started working on a function that allows selection of books based on its tag. Tagging each document with several tags e.g.: 'book programming vala' would show the document in the normal 'Books'-View, but also allows to fine-tune the selection with 'programming' and/or 'vala'.
Maybe I should post the new version as a pre-release so you can play with it in the emulator? (The new version also allows tagging multiple documents.)
Marcel.
Tags are very interesting of course.
And a fast and improved "Books" opening is as interesting
In my case (almost 3000 books) "Books" opening is very slow, so I can't fairly use it.

Maybe we could use vala to build the interfaces for tags and metadata (title, author) handling .


All in all, what I am only sure about is that I don't know what I want exactly...
only random ideas: tags, metadata, fast sort_by_recently_opened and sort_by_recently_added...

I have to rest these ideas.


Btw, as you'll have already noticed, I've published the vala package and new examples. Take a look at them and discover the beauty of vala

Iņigo
Iņigo is offline   Reply With Quote
Old 04-03-2011, 05:33 AM   #12
Mackx
Guru
Mackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to behold
 
Posts: 998
Karma: 19985
Join Date: Dec 2008
Location: Netherlands
Device: iRex DR1000S
Quote:
Originally Posted by Iņigo View Post
I was thinking in another way: instead of "wasting" one precious item on HOME (DR800 only allows 12 per page, 11 default links + 1 "continue reading last opened book"), my idea is to put a link on the popupmenu, not on ctb's HOME, which would open <SD card>/Programs folder.
It's easier to code and requires same work for the user, 2 clicks (menu and menu-link vs. HOME and home-link).
A, yes I see. I changed the View-code, so I can control which icons appear on Home and on which position.
Quote:
Originally Posted by Iņigo View Post
Maybe I'm missing something... but we could create specialized queries for each view, using LIMIT and OFFSET clauses we'd avoid retrieving DB rows for every book in the DR.
The only problem I can think of is the Sort by Title / Author that requires all the items to build the ABCDE toolbar at the right. Don't think the other view modes (by size, by file type, by recently opened, by added) require to retrieve all books.
There are two parts, retrieving them from global.db and storing them into a memory structure (and using the huge amount of data). For every kind of sorting, all records in the database need to be queried to be able to sort them all according to the sort-criteria. After that the LIMIT/OFFSET are applied. I am not sure what is causing the longest delay, reading all data from the database or having a lot of items in the internal memory? Some measurements should clear this up.

Quote:
Originally Posted by Iņigo View Post
All in all, what I am only sure about is that I don't know what I want exactly...
only random ideas: tags, metadata, fast sort_by_recently_opened and sort_by_recently_added...

I have to rest these ideas.
The recently opened and recently added already use LIMIT, if they also take a lot of time with 3000 books then the delay seems to be in the database access.
Quote:
Originally Posted by Iņigo View Post
Btw, as you'll have already noticed, I've published the vala package and new examples. Take a look at them and discover the beauty of vala
I already took a quick look, it indeed seems easier to program in vala then plain C.
Mackx is offline   Reply With Quote
Old 04-03-2011, 10:13 AM   #13
Iņigo
Guru
Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.
 
Posts: 712
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, in love with iRex DR800S. Also a K4NT. Now a Kobo Aura
Quote:
Originally Posted by Mackx View Post
There are two parts, retrieving them from global.db and storing them into a memory structure (and using the huge amount of data). For every kind of sorting, all records in the database need to be queried to be able to sort them all according to the sort-criteria. After that the LIMIT/OFFSET are applied. I am not sure what is causing the longest delay, reading all data from the database or having a lot of items in the internal memory? Some measurements should clear this up.
That's the part I can't understand... whay can we use sqlite SORT, OFFSET and LIMIT clauses?
SELECT xxx FROM yyy WHERE zzz SORTBY sort OFFSET ooo LIMIT lll;?

I took a look at that code some time ago and maybe I can't remember properly...

Quote:
Originally Posted by Mackx View Post
I already took a quick look, it indeed seems easier to program in vala then plain C.
yes, that's the idea


Iņigo
Iņigo is offline   Reply With Quote
Old 04-03-2011, 12:55 PM   #14
Mackx
Guru
Mackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to behold
 
Posts: 998
Karma: 19985
Join Date: Dec 2008
Location: Netherlands
Device: iRex DR1000S
Quote:
Originally Posted by Iņigo View Post
That's the part I can't understand... whay can we use sqlite SORT, OFFSET and LIMIT clauses?
SELECT xxx FROM yyy WHERE zzz SORTBY sort OFFSET ooo LIMIT lll;?

I took a look at that code some time ago and maybe I can't remember properly...
It is no problem to use the sql statement (see global_select_common() in \libs\ermetadb\src\ermetadb_file.c) but I wonder if it really saves time to use the OFFSET/LIMIT. What is causing the big delay in the book-view with 3000 books?
1) Selecting/sorting all data from global.db?
2) Or is it caused by the information of these 3000 books that is kept into memory after the query (including thumbnail info)?
After measuring what is causing the biggest delay in the current code, changes can be made to measure the effect. (I.e. using OFFSET/LIMIT or maybe delayed loading of thumbnails.)
Mackx is offline   Reply With Quote
Old 04-03-2011, 01:45 PM   #15
Mackx
Guru
Mackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to behold
 
Posts: 998
Karma: 19985
Join Date: Dec 2008
Location: Netherlands
Device: iRex DR1000S
There is already measurement code available, see ctb:filemodel.c search for TIMER_ON.
Mackx is offline   Reply With Quote
Reply

Tags
secret, suprise, testing

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange things happening w/PDF ebook Writernan Astak EZReader 5 04-05-2010 07:36 PM
Best firmware for Hanlin V5 aka Bebook Mini aka Papyre 5.1? javimm HanLin eBook 1 01-11-2010 06:37 PM
Strange things happening at Fictionwise... captaingeorges Bookeen 5 03-08-2009 06:20 AM
The Secret of Lost Things Taylor514ce Reading Recommendations 7 05-15-2008 10:06 AM
Strange things happening after Kindle update tsgreer Amazon Kindle 15 02-22-2008 06:34 PM


All times are GMT -4. The time now is 12:33 PM.


MobileRead.com is a privately owned, operated and funded community.