Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-gh-mirror
ensembl
Commits
a6b0996d
Commit
a6b0996d
authored
Jan 14, 2004
by
Graham McVicker
Browse files
made some caches larger, and made caching in fetch_all more intelligent
parent
d62e480d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
modules/Bio/EnsEMBL/DBSQL/SliceAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/SliceAdaptor.pm
+11
-5
No files found.
modules/Bio/EnsEMBL/DBSQL/SliceAdaptor.pm
View file @
a6b0996d
...
...
@@ -68,7 +68,7 @@ use Bio::EnsEMBL::Utils::Cache; #CPAN LRU cache
@ISA
=
('
Bio::EnsEMBL::DBSQL::BaseAdaptor
');
my
$SEQ_REGION_CACHE_SIZE
=
100
;
my
$SEQ_REGION_CACHE_SIZE
=
100
0
;
sub
new
{
my
$caller
=
shift
;
...
...
@@ -493,15 +493,21 @@ sub fetch_all {
my
$name_cache
=
$self
->
{'
_name_cache
'};
my
$id_cache
=
$self
->
{'
_id_cache
'};
my
$cache_count
=
0
;
my
$cs_key
=
lc
(
$cs
->
name
()
.
'
:
'
.
$cs_version
);
my
@out
;
while
(
$sth
->
fetch
())
{
#cache values for future reference
my
$key
=
lc
(
$name
)
.
'
:
'
.
$cs_key
;
$name_cache
->
{
$key
}
=
[
$seq_region_id
,
$length
];
$id_cache
->
{
$seq_region_id
}
=
[
$name
,
$length
,
$cs
];
#cache values for future reference, but stop adding to the cache once we
#we know we have filled it up
if
(
$cache_count
<
$SEQ_REGION_CACHE_SIZE
)
{
my
$key
=
lc
(
$name
)
.
'
:
'
.
$cs_key
;
$name_cache
->
{
$key
}
=
[
$seq_region_id
,
$length
];
$id_cache
->
{
$seq_region_id
}
=
[
$name
,
$length
,
$cs
];
$cache_count
++
;
}
#
# split the seq regions into appropriately sized chunks
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment